package cn.elwy.rcp.kit.intro;

import java.util.List;

import cn.elwy.common.jdbc.JdbcSupport;
import cn.elwy.common.jdbc.SingleDataSource;
import cn.elwy.osgi.config.model.DeployOperation;

public class ServiceTest {
  public static void main(String[] args) {

    Test();
  }

  public static void Test() {
    SingleDataSource dataSource = new SingleDataSource("oracle.jdbc.driver.OracleDriver",
        "jdbc:oracle:thin:@127.0.0.1:1521:orcl", "sofa", "sofa");
    JdbcSupport jdbcSupport = new JdbcSupport(dataSource);
    jdbcSupport.setFieldPrefix("F");
    jdbcSupport.query("select * from T_ACL_USER t");
    List<DeployOperation> query = jdbcSupport.query("select * from T_DEPLOY_OPERATION t", DeployOperation.class);

    jdbcSupport.update("delete from T_DEPLOY_OPERATION where fid=70012103");
    jdbcSupport.update(
        "insert into T_DEPLOY_OPERATION values(70012103,'sofa-log-config','日志记录管理',null,'/sofa-log/pages/log/log.jsp',null,0,1,23012102)");

    jdbcSupport.update("update T_DEPLOY_OPERATION set FNAME='sofa-log-config' where FID=70012103");

    System.out.println(query);
  }
}
